package com.xy.network.commoninterceptor

import okhttp3.Interceptor
import okhttp3.Response

/**
 * @ClassName CommonRequestInterceptor
 * @Author xy
 * @Date 2021/8/17 11:46
 * @Description 请求时拦截器
 */
class CommonRequestInterceptor:Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        //添加公共请求头
        val builder = chain.request().newBuilder()
        builder.addHeader("os","Android")
        builder.addHeader("mac","123456789")
        return chain.proceed(builder.build())
    }
}